package com.cloudwise.monitoring_system.util;

import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;

/**
 * @author Reisen
 * @description:动态数据源切换
 * @date 2021/6/1 9:34
 */
public class DynamicDataSource extends AbstractRoutingDataSource {

        @Override
        protected Object determineCurrentLookupKey() {
            return DataSourceContextHolder.getDB();
        }
}
